import $ from 'jquery'
//随机切换bgm
$(function () {
    let bgmArray = [
        {bgmPath: "./assets/audio/谕儿_My_Little_Fairytale.mp3"},
        {bgmPath: "./assets/audio/i_miss_you.mp3"},

    ]
    //随机数
    function selectFrom(startNumber, endNumber) {
        var choice = endNumber - startNumber + 1;
        return Math.floor(Math.random() * choice + startNumber)
    }

    let randomBgm = bgmArray[selectFrom(0,bgmArray.length-1)].bgmPath
    let $bgm = $(`<audio id="audio-love" src="${randomBgm}" preload="auto"></audio>`)
    $(".anni-page .content").append($bgm)
})
